<?php
/**
 * Created by Alan.
 * User: Alan
 * Date: 2018\10\7 0007
 * Time: 6:12
 */

namespace app\admin\validate;


class CategoryValidate extends BaseValidate
{
    protected $rule = [
        ['name','require|max:8'],
        ['parent_id','require|number'],
        ['id','number'],
        ['status','number|in:1,0,-1'],
        ['listorder','number']
    ];

    protected $scene = [
        'add' => ['name','parent_id','id'],//添加
        'listorder' => ['id','listorder'], //排序
        'status' =>['id','status']
    ];

}